package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.RegulatorApplyTemporaryConMapper;
import com.ruoyi.consume.domain.RegulatorApplyTemporaryCon;
import com.ruoyi.consume.service.IRegulatorApplyTemporaryConService;

/**
 * 调节剂临时领用Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class RegulatorApplyTemporaryConServiceImpl implements IRegulatorApplyTemporaryConService
{
    @Autowired
    private RegulatorApplyTemporaryConMapper regulatorApplyTemporaryConMapper;

    /**
     * 查询调节剂临时领用
     *
     * @param regulatorApplyTemporaryId 调节剂临时领用ID
     * @return 调节剂临时领用
     */
    @Override
    public RegulatorApplyTemporaryCon selectRegulatorApplyTemporaryById(Long regulatorApplyTemporaryId)
    {
        return regulatorApplyTemporaryConMapper.selectRegulatorApplyTemporaryById(regulatorApplyTemporaryId);
    }

    /**
     * 查询调节剂临时领用列表
     *
     * @param regulatorApplyTemporaryCon 调节剂临时领用
     * @return 调节剂临时领用
     */
    @Override
    public List<RegulatorApplyTemporaryCon> selectRegulatorApplyTemporaryList(RegulatorApplyTemporaryCon regulatorApplyTemporaryCon)
    {
        return regulatorApplyTemporaryConMapper.selectRegulatorApplyTemporaryList(regulatorApplyTemporaryCon);
    }

    /**
     * 新增调节剂临时领用
     *
     * @param regulatorApplyTemporaryCon 调节剂临时领用
     * @return 结果
     */
    @Override
    public int insertRegulatorApplyTemporary(RegulatorApplyTemporaryCon regulatorApplyTemporaryCon)
    {
        regulatorApplyTemporaryCon.setCreateTime(DateUtils.getNowDate());
        return regulatorApplyTemporaryConMapper.insertRegulatorApplyTemporary(regulatorApplyTemporaryCon);
    }

    /**
     * 修改调节剂临时领用
     *
     * @param regulatorApplyTemporaryCon 调节剂临时领用
     * @return 结果
     */
    @Override
    public int updateRegulatorApplyTemporary(RegulatorApplyTemporaryCon regulatorApplyTemporaryCon)
    {
        regulatorApplyTemporaryCon.setUpdateTime(DateUtils.getNowDate());
        return regulatorApplyTemporaryConMapper.updateRegulatorApplyTemporary(regulatorApplyTemporaryCon);
    }

    /**
     * 批量删除调节剂临时领用
     *
     * @param regulatorApplyTemporaryIds 需要删除的调节剂临时领用ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorApplyTemporaryByIds(Long[] regulatorApplyTemporaryIds)
    {
        return regulatorApplyTemporaryConMapper.deleteRegulatorApplyTemporaryByIds(regulatorApplyTemporaryIds);
    }

    /**
     * 删除调节剂临时领用信息
     *
     * @param regulatorApplyTemporaryId 调节剂临时领用ID
     * @return 结果
     */
    @Override
    public int deleteRegulatorApplyTemporaryById(Long regulatorApplyTemporaryId)
    {
        return regulatorApplyTemporaryConMapper.deleteRegulatorApplyTemporaryById(regulatorApplyTemporaryId);
    }

    /**
     * 更新库存量表
     *
     * @param regulatorApplyTemporaryCon 调节剂临时领用
     * @return 结果
     */
    @Override
    public int updateAmount(RegulatorApplyTemporaryCon regulatorApplyTemporaryCon){
        return regulatorApplyTemporaryConMapper.updateAmount(regulatorApplyTemporaryCon);
    }

    /**
     * 更新领用状态
     *
     * @param regulatorApplyTemporaryId 调节剂临时领用ID
     * @return 结果
     */
    @Override
    public int updateConsumeStatus(Long regulatorApplyTemporaryId){
        return regulatorApplyTemporaryConMapper.updateConsumeStatus(regulatorApplyTemporaryId);
    }

    /**
     * 退回操作
     *
     * @param regulatorApplyTemporaryId 调节剂临时领用ID
     * @return 结果
     */
    @Override
    public int updateApprovalStatus(Long regulatorApplyTemporaryId){
        return regulatorApplyTemporaryConMapper.updateApprovalStatus(regulatorApplyTemporaryId);
    }
}
